<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>Document</title>
</head>
<body>
  <script>
    function* weaponGenerator(){
      yield "Katana",
      yield "Wakizashi";
      yield "Kusarigame";
    }

    for(let weapon of weaponGenerator()){
      console.log(weapon !== undefined);
    }
    function* Idgenerator(){
      let id = 0;
      while(true){
        yield ++id;
      }
    }
    const idIterator =Idgenerator();
    console.log(idIterator.next().value);
    console.log(idIterator.next().value);
      
  </script>
</body>
</html>